Developer Documentation
PATH  WebObjects 4.0 Documentation > WebObjects Tools and Techniques

Table of Contents Previous Section

Linking to a Direct to Web Page

In addition to embedding static Direct to Web components, your application can link directly to a dynamically-generated page of the appropriate type. The technique for doing this has two basic requirements:

For pages whose next page is dynamically determined (such as query pages), the action method must do more than simply return the page component. See "Setting Up a Next-Page Callback" for detals.

Setting Up the Page Wrapper

Every application that links to a dynamically-created Direct to Web page must have a component called PageWrapper.wo. This component acts as a "wrapper" for the dynamically-generated content, and can have customized header and footer material. The following example shows how to set up the PageWrapper.wo component. You can use a text editor, Project Builder, or (preferably) WebObjects Builder to construct this component.

PageWrapper.html example:

<html><webObject name=Head></webObject><webObject name=BodyContainer><webObject name=Body></webObject></webObject> </html>
PageWrapper.wod example:

BodyContainer: WOBody {
    filename = "Images/bkg.jpg";
    framework = "DodgeDemo";
        bgcolor="#c0c0c0";
    TEXT = "#000000";
    LINK = "#0000F0";
    VLINK = "#0000F0";
    ALINK = "#FF0000";
}

Head : D2WHead {
    _unroll = YES;
}

Body: WOComponentContent {
    _unroll = YES;
};
The only required component in PageWrapper.wo is the WOComponentContent. The other components shown in the example are optional, and you can create your own header, footer, and body-container components for your dynamically-generated pages.

The _unroll attribute, when YES, enables the WebAssistant to generate a static component from the dynamically-generated one.

Table of Contents Next Section